﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
	<link href="__CSS__bootstrap.min.css" type="text/css" rel="stylesheet">
	<script src="__JS__jquery-3.1.1.min.js"></script>
	<script src="__JS__bootstrap.min.js"></script>
<link  rel="stylesheet" href="__C2CSS__main.css" />
<link rel="stylesheet" type="text/css" href="__C2CSS__sinaFaceAndEffec.css" />
<!--<script type="text/javascript" src="__C2JS__jquery-1.8.3.min.js"></script>-->
<title>DMF留言板</title>
</head>
<body>
<!--头部-->
<include file="Public:header1"/>

<div>
	<div class="img-responsive">
		<img class="img-responsive" style="width:100%;height:25em;" src="__C2IMGS__top.jpg">
	</div>
	<div class="col-sm-12 col-md-12">
		<img style="margin: 1em auto;" class="img-responsive img-rounded col-sm-2 col-md-2" src="__C2IMGS__my.jpg">
		<h1 style="margin-top: 2.5em;" class="col-sm-10 col-md-10">有什么想和博主说的请写下来呀<small>&nbsp;&nbsp;&nbsp;你说的每一句话博主都会看到的哦</small></h1>

	</div>
	<div class="col-sm-12 col-md-12" style="height:0.5em;background-color: #00cc66;margin: 1em auto;"></div>
	<div class="col-sm-12 col-md-12" id="info-show">
		<ul></ul>

            <volist name="commentsdata" id="vo">
                   <li>
                        <div class="head-face">
                            <img src="__C2IMGS__1.jpg">
                       </div>
                        <div class="reply-cont">
                           <p class="username">{$vo['username']}</p>
                            <p class="comment-body">{$vo['content']}</p>
                            <p class="comment-footer">  {$vo['time']}</p>
                        </div>
                    </li>
								
            </volist>

	</div>
</div>

<div class="col-sm-12 col-md-12" id="content" style="margin-top:40px;margin-bottom:40px">
	<div class="wrap col-sm-offset-1 col-md-offset-1 col-sm-10 col-md-10">
		<div class="comment">
			<div class="head-face">
				<img src="__C2IMGS__1.jpg">
				<p class="username">我是鸟</p>
			</div>
			<div class="content">
				<div class="cont-box">
					<textarea  class="text" placeholder="请输入..."></textarea>
				</div>
				<div class="tools-box">
					<div class="operator-box-btn"><span class="face-icon"  >☺</span><span class="img-icon">▧</span></div>
					<div class="submit-btn"><input type="button" onClick="out()"value="提交评论" /></div>
				</div>
			</div>
		</div>
	</div>
</div>

<!--尾部-->
<include file="Public:footer" />

</body>

<script type="text/javascript" src="__C2JS__main.js"></script>
<script type="text/javascript" src="__C2JS__sinaFaceAndEffec.js"></script>
<script type="text/javascript">
    //时间返回
    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                + " " + date.getHours() + seperator2 + date.getMinutes()
                + seperator2 + date.getSeconds();
        return currentdate;
    }
	
	// 绑定表情
	$('.face-icon').SinaEmotion($('.text'));
	// 测试本地解析
	function out() {
		var inputText = $('.text').val();
		//$('#info-show ul').append(reply(AnalyticEmotion(inputText)));
        $('.text').val(null);
        var time = getNowFormatDate();
        var username = $('.username').val();
		if(inputText==null){
			alert("留言不能为空！");
			return;
		}
        $.ajax({
            "url":"__ADMIN__Component/message_board",
            "type":"POST",
            "dataType":"html",
            "data":{
                "time":time,
                "content":inputText,
                "username":username
            },
            "error": function(XMLHttpRequest, textStatus, errorThrown) {
                alert(XMLHttpRequest.status);
                alert(XMLHttpRequest.readyState);
                alert(textStatus);
            },
            "success":function(data,textStatus){
                //alert(data);
				if(data=='llbnwk'){
					alert('留言不能为空！');
				}
               window.location.reload();
                //alert("成功了");
            }
        });
	}
	
	var html;
    function reply(content) {
        html  = '<li>';
		html += '<div class="head-face">';
		html += '<img src="__C2IMGS__1.jpg">';
		html += '</div>';
		html += '<div class="reply-cont">';
		html += '<p class="username">小小红色飞机</p>';
		html += '<p class="comment-body">'+content+'</p>';
		html += '<p class="comment-footer">2016年10月5日　回复　点赞54　转发12</p>';
		html += '</div>';
		html += '</li>';
		return html;
	}
</script>


</html>

